﻿class User < ActiveRecord::Base
  attr_accessible :Address, :BirthDay, :EmailAddress, :FirstName, :LastName, :MidName, :Password, :ReceiveEmail, :UserName, :Password_confirmation
  validates :UserName, :presence => true, :uniqueness => true
  validates :Password, :presence =>true, :confirmation => true
  attr_accessor :Password_confirmation
  
  
   
	def User.authenticate(name, password)
    if user = find_by_UserName(name)
      if user.Password == password
        user
      end
    end
  end
end
